home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11831 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mother.usf.edu!news
  2. From: yatesc@csee.usf.edu (Randy Yates)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pointers to register
  5. Date: 26 Mar 1996 22:12:13 GMT
  6. Organization: University of South Florida
  7. Message-ID: <4j9q3t$kct@mother.usf.edu>
  8. References: <1239@altheim.win-uk.net><4iklpm$28s@sparcserver.lrz-muenchen.de> <1247@altheim.win-uk.net>
  9. NNTP-Posting-Host: ppp113.cfr.usf.edu
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.93.14
  12.  
  13. In article <1247@altheim.win-uk.net>, broldham@altheim.win-uk.net says...
  14. >
  15. >In article <4iklpm$28s@sparcserver.lrz-muenchen.de>, Kurt Watzka (watzka@stat.uni-muenchen.de) writes:
  16. >>broldham@altheim.win-uk.net (Brian R. Oldham) writes:
  17. >[...]
  18. >Yes Kurt, I think I've got the message by now. But where you guys keep
  19. >missing the point (like Nottm Forest kept missing the Bayern Munich
  20. >goalposts :-{ ) is that if declaration:
  21. >
  22. >    *ptr = var;
  23. >    
  24. >is wrong for other objects in memory 
  25.  
  26. It is? Who says?
  27.  
  28. >then why does it work for:
  29. >
  30. >    *ptr = union_member;
  31. >
  32. >And why does my compiler complain at the correct way:
  33. >
  34. >    ptr = &union_member;
  35.  
  36. These last two examples do different things: *ptr=union_member reads
  37. the data in union_member and writes it to the address stored in
  38. the pointer variable ptr; ptr=&union_member assigns the pointer variable
  39. the address of the union_member. 
  40.  
  41. >
  42. >---
  43. >Brian Oldham
  44. >Hucknall UK
  45. >!...Gesundbrunnen
  46. >
  47. >
  48. >
  49. >
  50. >
  51. >
  52. >
  53. >
  54.  
  55. -- 
  56. % Randy Yates                  % "...the answer lies within your soul
  57. % EE/Mathematics Student       %       'cause no one knows which side 
  58. % University of South Florida  %                   the coin will fall."
  59. % <yatesc@csee.usf.edu>        %  'Big Wheels', *Out of the Blue*, ELO   
  60.  
  61.